home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-26 | 3.5 KB | 67 lines | [TEXT/$Tcl] |
-
-
- signal action siglist ?command?
- Specify the action to take when a Unix signal is
- received by Extended Tcl, or a program that embeds it.
- Siglist is a list of either the symbolic or numeric
- Unix signal (the SIG prefix is optional). Action is
- one of the following actions to be performed on receipt
- of the signal.
-
- default - Perform system default action when signal is
- received (see signal system call documentation).
-
- ignore - Ignore the signal.
-
- error - Generate a catchable Tcl error. It will be as
- if the command that was running returned an error. The
- error code will be in the form:
- POSIX SIG signame
- For the death of child signal, signame will always be
- SIGCHLD, rather than SIGCLD, to allow writing portable
- code.
-
- trap - When the signal occurs, execute command and con-
- tinue execution if an error is not returned by command.
- The command will be executed in the global context.
- The command will be edited before execution, replacing
- occurrences of "%S" with the signal name. Occurrences
- of "%%" result in a single "%". This editing occurs
- just before the trap command is evaluated. If an error
- is returned, then follow the standard Tcl error mechan-
- ism. Often command will just do an exit.
-
- get - Retrieve the current settings of the specified
- signals. A keyed list will be returned were the keys
- are one of the specified signals and the values are a
- list cosisting of the action associated with the sig-
- nal, a 0 if the signal may be delivered (not block) and
- a 1 if it is blocked. The actions maybe one of
- `default',`ignore', `error' or `trap. If the action is
- trap, the third element is the command associated with
- the action.
-
- block - Block the specified signals from being
- received. (Posix systems only).
-
- unblock - Allow the specified signal to be received.
- Pending signals will not occur. (Posix systems only).
-
- The signal action will remain enabled after the speci-
- fied signal has occurred. The exception to this is
- SIGCHLD on systems without Posix signals. For these
- systems, SIGCHLD is not be automatically reenabled.
- After a SIGCHLD signal is received, a call to wait must
- be performed to retrieve the exit status of the child
- process before issuing another signal SIGCHLD ... com-
- mand. For code that is to be portable between both
- types of systems, use this approach.
-
- Signals are not processed until after the completion of
- the Tcl command that is executing when the signal is
- received. If an interactive Tcl shell is running, then
- the SIGINT will be set to error, non-interactive Tcl
- sessions leave SIGINT unchanged from when the process
- started (normally default for foreground processes and
- ignore for processes in the background).
-